<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>呼叫云</title>
    <link rel="shortcut icon" href="../img/logox_circle.png">
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
    <script src="../js/jquery-1.11.0.min.js"></script> 
    <script src="../js/config.js"></script> 
    <script src="../js/fenye.js"></script> 
	<script>
		$(function(){
			$("#showName").val("tasks2");
			//总条数
			var counts = ${count};
			//总页数
			var pageCouts = "";
			if(counts % 10 == 0){
				pageCouts =  parseInt(counts/10);
			}else{
				pageCouts =  parseInt(counts/10) + 1;
			}
			pg = new showPages('pg','${page}',pageCouts,counts);
			
			pg.printHtml(2,pageCouts);        //显示页数
			
			showPages.prototype.createUrl = function (page) { //生成页面跳转url
				if (isNaN(parseInt(page))) page = 1;
				if (page < 1) page = 1;
				if (page > this.pageCount) page = this.pageCount;
				var url = location.protocol + '//' + location.host + location.pathname +"?page="+page;
				
				//获取参数
				var loginName = $("#loginName").val();
				if(loginName != ""){
					url = url+"&loginName="+loginName;
				}
				var name = $("#name").val();
				if(name != ""){
					url = url+"&name="+name;
				}
				var taskName = $("#taskName").val();
				if(taskName != ""){
					url = url+"&taskName="+taskName;
				}
				var bindPhone = $("#bindPhone").val();
				if(bindPhone != ""){
					url = url+"&bindPhone="+bindPhone;
				}
				var status = $("#status").val();
				url = url+"&status="+status;
				
				return url;
			}
			
		});
		//获取客服任务详情
		function getUserTask(userTaskID){
			var url = window.location.search;
			if(url != ""){
				location.href=serviceConfig.task.getUserTask+"?userTaskID="+userTaskID+"&url="+escape(url);
			}else{
				location.href=serviceConfig.task.getUserTask+"?userTaskID="+userTaskID;
			}
		}
		
		//添加操作
		function addHandle(userTaskID){
			var url = window.location.search;
			if(url != ""){
				location.href=serviceConfig.task.upUserTaskToPage+"?userTaskID="+userTaskID+"&url="+escape(url);
			}else{
				location.href=serviceConfig.task.upUserTaskToPage+"?userTaskID="+userTaskID;
			}
		}
		
		//获取操作详情
		function getHandle(userTaskID){
			var url = window.location.search;
			if(url != ""){
				location.href=serviceConfig.task.getHandle+"?userTaskID="+userTaskID+"&url="+escape(url);
			}else{
				location.href=serviceConfig.task.getHandle+"?userTaskID="+userTaskID;
			}
		}
	</script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img style="width:100%;" src="../img/logo3.png" alt="呼叫云后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
            	<span id="user_name"></span>
                <a class="button button-little bg-yellow" href="login">注销登录</a>
            </span>
           <#include "../common/head.ftl"> 
        </div>
        <div class="admin-bread">
            <ul class="bread">
                <li><a class="icon-tasks"> 任务管理</a></li>
                <li><a >客服任务</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="admin">
    <div class="line-big">
		<div class="xm12">
			<form action="getUserTaskList" method="get">
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>用户名：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="loginName" name="loginName" value="${loginName}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>客服名称：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="name" name="name" value="${name}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>任务名称：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="taskName" name="taskName" value="${taskName}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>绑定手机号：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="bindPhone" name="bindPhone" value="${bindPhone}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>状态：</strong></div>
			<div class="xm1" style="padding:0px;">
				<select class="input" id="status" style="width:110%;" name="status">
					<option value="" >请选择呼叫类型</option>
					<option value="4" <#if status=='4' > selected </#if>>已申请</option>
					<option value="5" <#if status=='5' > selected </#if>>已通过</option>
					<option value="36" <#if status=='36' > selected </#if>>未通过</option>
					<option value="62" <#if status=='62' > selected </#if>>已通过(未分配坐席)</option>
					<option value="63" <#if status=='63' > selected </#if>>已邀请</option>
					<option value="64" <#if status=='64' > selected </#if>>已拒绝邀请</option>
				</select>
			</div><br/><br/><br/>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>坐席号：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="phoneNumber" name="phoneNumber" value="${phoneNumber}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>操作员账号：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="agentNumber" name="agentNumber" value="${agentNumber}"/>
			</div>
			<div class="xm1" style="padding:0px;text-align:center;">
				<button class="button bg-main" type="submit">搜索</button>
			</div>
			</form>
		</div>
	</div>
    <div class="panel admin-panel" style="margin-top:20px;">
		
    	<div class="panel-head"><strong>客服任务列表</strong></div>
        
        <table class="table table-hover">
        	<tr>
				<th width="40">序号</th>
				<th width="80">用户名</th>
				<th width="80">姓名</th>
				<th width="100">绑定手机号</th>
				<th width="180">任务名称</th>
				<th width="100">任务描述</th>
				<th width="180">任务生效时间</th>
				<th width="80">签到状态</th>
				<th width="150">签到时间</th>
				<th width="150">状态</th>
				<th width="150">创建时间</th>
				<th width="150">修改时间</th>
				<th width="100">操作</th>
			</tr>
			<#list userTaskList as userTaskMap>
				<#if count gt 0 >
				<tr>
					<td>${userTaskMap_index+1}</td>
						<td>${userTaskMap.loginName}</td>
					    <td>${userTaskMap.name}</td>
					    <td>${userTaskMap.bindPhone}</td>
						<td>${userTaskMap.title}</td>
						<td>${userTaskMap.desc}</td>
						<td>${userTaskMap.effectiveTime}</td>
						<td>
							<#if userTaskMap.signstatus==0 >
								未签到
							<#elseif userTaskMap.signstatus==1 >
								已签到
							<#else>
								
							</#if>
						</td>
						<td>${userTaskMap.clientSigntime}</td>
						<td>${userTaskMap.status}</td>
						<td>${userTaskMap.createTime}</td>
						<td>${userTaskMap.updateTime}</td>
						<td>
							<a class="button border-blue button-little" href="#" onclick="getUserTask('${userTaskMap.userTaskID}')">查看</a>
							<#if userTaskMap.statusID== '62' >
								<a class="button border-yellow button-little" href="#" onclick="addHandle('${userTaskMap.userTaskID}')">添加操作</a>
							<#elseif userTaskMap.statusID== '5' >
								<a class="button border-blue button-little" href="#" onclick="getHandle('${userTaskMap.userTaskID}')">操作信息</a>
							<#else>
								
							</#if>
						</td>
				</tr>
				</#if>
			</#list>
			
        </table>
        <div class="panel-foot text-center">
				<#if count gt 0 >
		            <!--<ul class="pagination"><li><a href="#">上一页</a></li></ul>
		            <ul class="pagination pagination-group">
		                <li class="active"><a href="#">1</a></li>
		                <li><a href="#">2</a></li>
		                <li><a href="#">3</a></li>
		                <li><a href="#">4</a></li>
		                <li><a href="#">5</a></li>
		            </ul>
		            <ul class="pagination"><li><a href="#">下一页</a></li></ul>-->
		            
		            
		             <div class="page" id="pages"></div>
		            
		            
		        <#else>
		       <div style="padding-top:30px;"><strong>没有相关数据</strong></div>
				</#if>
        </div>
    </div>
    <br />
</div>

</body>
</html>